package com.chem.lems.controller;

import com.chem.lems.serves.MenusServies;
import com.chem.lems.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rights")
public class RightsController {
    @Autowired
    private MenusServies menusServies;

    /**
     * 获取所有菜单列表，不生成树状结构
     *
     * @return
     */
    @GetMapping()
    public ResultUtil gitMenusList() {
        return menusServies.getMenusList();
    }

    /**
     * 获取所有菜单列表，生成树状结构
     *
     * @return
     */
    @GetMapping("/tree")
    public ResultUtil gitMenusTree() {
        return menusServies.gitMenusTree();
    }
}
